/*
 * ©2009-2018 南京擎盾信息科技有限公司 All rights reserved.
 */
package com.wuhao.code.check.inspection.inspections

import com.intellij.codeInspection.InspectionToolProvider
import com.intellij.codeInspection.LocalInspectionTool
import com.wuhao.code.check.isIdea
import com.wuhao.code.check.kotlinEnabled

/**
 * @author 吴昊
 * @since 1.0
 */
class CheckProvider : InspectionToolProvider {

  override fun getInspectionClasses(): Array<out Class<out LocalInspectionTool>> {
    val classes = arrayListOf<Class<out LocalInspectionTool>>()
    if (isIdea) {
      classes.add(JavaMapperMethodInspection::class.java)
      if (kotlinEnabled) {
        classes.add(KotlinMapperMethodInspection::class.java)
        classes.add(MybatisXmlInspection::class.java)
      }
    }
    return classes.filter { it.superclass == BaseInspection::class.java }.toTypedArray()
  }

}
